package org.reliablesource.prism.ui.workbench.views;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;
import org.reliablesource.prism.ui.viewers.PrismViewer;

/**
 *
 *  PrismViewPart.java
 *  Copyright (c) 2007, Reliable Source, Inc. All Rights Reserved<br><br>
 *
 *	Created on: Jan 3, 2007<br>
 *  @author Dennis Park 
 *  <a href="mailto:dennis.park@gmail.com">dennis.park@gmail.com</a>
 *
 *	@since 1.0
 */

abstract public class PrismViewPart extends ViewPart {

	protected PrismViewer contentViewer;
	
	/*
	 * (non-Javadoc)
	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
	 */
	@Override
	public void createPartControl(Composite parent) {
		contentViewer = createContentViewer();
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
	 */
	@Override
	public void setFocus() {
		contentViewer.getControl().setFocus();
	}

	/**
	 * @return PrismViewer - the content viewer.
	 * @category lifecycle
	 */
	abstract public PrismViewer createContentViewer();
	
}
